package com.liuyang.concurrency.chapter8;

public class OhterService {


    private final Object lock = new Object();
    private DeadLock deadLock;

    public void s1(){
        synchronized(lock){
            System.out.println("s1==================");
            deadLock.m1();
        }
    }

    public void s2(){
        synchronized (lock){
            System.out.println("s2================");
            deadLock.m2();
        }
    }

    public void setDeadLock(DeadLock deadLock){
        this.deadLock = deadLock;
    }
}
